Roc Toolkit internal modules
Roc Toolkit: real-time audio streaming
Loading...
Searching...
No Matches
attributes.h
Go to the documentation of this file.
1/*
2 * Copyright (c) 2015 Roc authors
3 *
4 * This Source Code Form is subject to the terms of the Mozilla Public
5 * License, v. 2.0. If a copy of the MPL was not distributed with this
6 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
7 */
8
9//! @file roc_core/target_gcc/roc_core/attributes.h
10//! @brief GCC attributes.
11
12#ifndef ROC_CORE_ATTRIBUTES_H_
13#define ROC_CORE_ATTRIBUTES_H_
14
15//! Function never throws.
16#define ROC_ATTR_NOTHROW throw()
17
18//! Function never returns.
19#define ROC_ATTR_NORETURN __attribute__((noreturn))
20
21//! Function or variable is never used but no warning should be generated.
22#define ROC_ATTR_UNUSED __attribute__((unused))
23
24//! Structure's fields are packed.
25#define ROC_ATTR_PACKED __attribute__((packed))
26
27//! Function gets printf-like arguments.
28#define ROC_ATTR_PRINTF(n_fmt_arg, n_var_arg) \
29 __attribute__((format(printf, n_fmt_arg, n_var_arg)))
30
31#endif // ROC_CORE_ATTRIBUTES_H_